package com.fzu.ess.sys.entity;

import com.fzu.ess.common.entity.BaseEntity;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by ercha on 2015/10/16.
 */
@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@DynamicInsert
@DynamicUpdate
@Table(name = "sys_message")
public class Message extends BaseEntity {

    public Message(){
    }

    public Message(String id){
        this.id = id;
    }

    @Column(name = "title")
    private String title;           //标题

    @Column(name = "content")
    private String content;         //内容

    @Column(name = "sender")
    private String sender;            //发送者 Id，系统自动发送则设为 null

    @Column(name = "receiver")
    private String receiver;          //接收者 Id

    /**
     * 0: 未读
     * 1: 已读
     */
    @Column(name = "status")
    private Integer status = 0;

    public static final Integer UNREAD_STATUS = 0;
    public static final Integer READ_STATUS = 1;
}
